:root {
  --primary: #4361ee;
  --secondary: #3f37c9;
  --success: #4cc9f0;
  --danger: #f72585;
  --light: #f8f9fa;
  --dark: #212529;
}

.app-container {
  display: flex;
  height: 100vh;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

.sidebar {
  width: 300px;
  border-right: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
}

.toolbar {
  padding: 12px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  gap: 8px;
}

.toolbar button,
.import-btn {
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.toolbar button {
  background: var(--primary);
  color: white;
}

.toolbar button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.import-btn {
  background: #e9ecef;
  color: var(--dark);
}

.endpoint-list {
  flex: 1;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 列表项悬浮效果 */
.ant-list-item {
  transition: all 0.3s ease;
}

.ant-list-item:hover {
  cursor: pointer;
  background-color: #f5f5f5;
  transform: translateX(5px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 点击状态 */
.ant-list-item:active {
  transform: translateX(5px) scale(0.98);
  background-color: #e6f7ff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* 选中状态（需配合JS） */
.ant-list-item.active {
  background-color: #e6f7ff;
  border-left: 3px solid #1890ff;
  transform: translateX(5px);
}

.ant-list-bordered .ant-list-item:hover {
  border-left: 3px solid #1890ff;
}

.method {
  font-weight: bold;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 3px;
  color: white;
}

.method.GET {
  background: #28a745;
}

.method.POST {
  background: #007bff;
}

.method.PUT {
  background: #ffc107;
  color: #212529;
}

.method.DELETE {
  background: #dc3545;
}

.method.PATCH {
  background: #eef106;
}

.method.HEAD {
  background: #77cf8c;
}

.endpoint-detail {
  display: flex;
  flex-direction: column;
  min-width: 600px;
  gap: 4px;
}

.endpoint-index {
  color: #6c757d;
  font-size: 18px;
  text-align: center;
  margin-top: 0px;
}

.method-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 3px;
  margin-right: 12px;
  font-weight: bold;
  font-size: 14px;
}

.url {
  font-family: monospace;
  color: #6c757d;
}

.test-btn {
  margin-top: 20px;
  padding: 10px 20px;
  background: var(--success);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: 40vh;
  }
}

/* 新增复选框样式 */
.endpoint-list input[type="checkbox"] {
  margin-right: 12px;
  cursor: pointer;
}

.list-item {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  align-items: flex-start;
  gap: 4px;
}

.ant-list-item span.truncate {
  display: block;
  /* 行内元素需转换显示模式 */
  max-width: 25ch;
  /* 限制20个字符宽度 */
  white-space: nowrap;
  /* 禁止换行 */
  overflow: hidden;
  /* 隐藏溢出内容 */
  text-overflow: ellipsis;
  /* 溢出显示省略号 */
  margin-left: 5px;
  align-self: flex-start;
}

.ant-list-item div.method-tags {
  display: flex;
  gap: 0px;
  margin-top: 4px;
  margin-right: 15px;
  justify-content: flex-end;
  width: 100%;
}

/* 防止复选框点击触发行点击 */
.list-item>*:not(input) {
  pointer-events: none;
}

ing,
.error {
  padding: 20px;
  text-align: center;
  font-size: 18px;
}

.error {
  color: #ff4d4f;
}


.demo-logo {
  width: 120px;
  min-width: 120px;
  height: 32px;
  background: rgba(250, 246, 246, 0.918);
  border-radius: 6px;
  margin-inline-end: 24px;
}

.select-version {
  position: absolute;
  right: 25px;
}

.api-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.api-version {
  margin-bottom: -22px;
}


/* 代码块容器相对定位 */
.code-container {
  position: relative;
  margin: 1em 0;
}

/* 复制按钮绝对定位 */
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  background: rgba(30, 30, 30, 0.7);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: opacity 0.3s;
  z-index: 1;
}

/* 鼠标悬停效果 */
.copy-btn:hover {
  background: rgba(30, 30, 30, 0.9);
}

/* 适配深色/浅色主题 */
.copy-btn.dark {
  background: rgba(200, 200, 200, 0.7);
  color: #333;
}

.copy-btn.dark:hover {
  background: rgba(200, 200, 200, 0.9);
}